﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OracleClient;

namespace oraclexue
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string ConnectionString = "Data Source=orcl;Persist Security Info=True;user=viot;password=viot;";
            OracleConnection conn = new OracleConnection(ConnectionString);
            try
            {
                conn.Open();
                OracleCommand cmd = conn.CreateCommand();
                cmd.CommandText = "select * from ZHXT_DBA_MV_RS_RYXXB";
                OracleDataReader odr = cmd.ExecuteReader();
                while (odr.Read())
                {
                    MessageBox.Show(odr.GetOracleString(1).ToString());
                }
                odr.Close();
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
            finally
            {
                conn.Close();
            }
        }
    }
}
